const generateSidebar = require('./utils/sidebarGenerator');
const path = require('path');

module.exports = {
  title: '技术知识库',
  description: '个人技术学习笔记',
  themeConfig: {
    nav: [
      { text: '首页', link: '/' },
      { 
        text: '编程语言', 
        items: [
          { text: 'C', link: '/c/' },
          { text: 'C++', link: '/c++/' },
          { text: 'Go', link: '/go/' },
          { text: 'Java', link: '/java/' },
          { text: 'JavaScript', link: '/java-script/' },
          { text: 'Kotlin', link: '/kotlin/' },
          { text: 'PHP', link: '/php/' },
          { text: 'Python', link: '/python/' },
          { text: 'Rust', link: '/rust/' },
          { text: 'Spring', link: '/spring/' },
          { text: 'Spring-boot', link: '/spring-boot/' },
          { text: 'Swift', link: '/swift/' },
          { text: 'TypeScript', link: '/type-script/' }
        ]
      },
      { text: '关于', link: '/about/' }
    ],
    // 自动生成 sidebar，支持多个路径
    sidebar: generateSidebar([
      path.join(__dirname, '../c'),
      path.join(__dirname, '../c++'),
      path.join(__dirname, '../go'),
      path.join(__dirname, '../java'),
      path.join(__dirname, '../java-script'),
      path.join(__dirname, '../kotlin'),
      path.join(__dirname, '../php'),
      path.join(__dirname, '../python'),
      path.join(__dirname, '../rust'),
      path.join(__dirname, '../spring'),
      path.join(__dirname, '../spring-boot'),
      path.join(__dirname, '../swift'),
      path.join(__dirname, '../type-script')
    ])
  },
  head: [
    ['link', { rel: 'icon', href: '/favicon.ico' }]
  ]
}
